home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 235 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: clamage@Eng.sun.com (Steve Clamage)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: delete this
  5. Date: 2 Feb 1996 01:23:55 GMT
  6. Organization: Sun Microsystems Inc.
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4ernoe$4hh@engnews1.Eng.Sun.COM>
  9. References: <31115249.5549@hpato.aus.hp.com>
  10. Reply-To: clamage@Eng.sun.com
  11. NNTP-Posting-Host: taumet.eng.sun.com
  12. Content-Type: text
  13. X-Nntp-Posting-Host: taumet.eng.sun.com
  14. Content-Length: 681
  15. X-Lines: 18
  16. Originator: clamage@taumet
  17.  
  18. In article 5549@hpato.aus.hp.com, Earl Chew <earl@hpato.aus.hp.com> writes:
  19. >I believe that `delete this' is "unsafe".
  20. >
  21. >Does the draft standard say this explicitly?
  22.  
  23. The draft says you must not access a deleted object. If you delete 'this',
  24. you can't touch the object or call any functions on it. The draft
  25. also says you must not destroy an object twice, and deleting "this"
  26. will destroy it once.
  27.  
  28. So, yes, deleting "this" is in general unsafe, since it is harder to 
  29. make the "no touch" guarantees from inside a member function. You can
  30. design a program so that deleting "this" is appropriate, but such
  31. programs are not common. 
  32. ---
  33. Steve Clamage, stephen.clamage@eng.sun.com
  34.  
  35.  
  36. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  37.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  38.   summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  39. ]
  40.